package com.im.entity;

import java.util.Date;

public class Article extends BasicEntity implements Comparable<Article> {
	private String title = "";
	private String content = "";
	private String summary = "";
	private Date date;
	private int top_value;
	private int read_count;
	private String column_url;
	
	public Article() {
		super();
	}

	public Article(int id, String title, String content, Date date, String url, int top_value, String type, String summary, int read_count) {
		super();
		this.id = id;
		this.title = title;
		this.content = content;
		this.summary = summary;
		this.date = date;
		this.url = url;
		this.top_value = top_value;
		this.type = type;
		this.read_count = read_count;
	}
	
	public Article(String title, String content, Date date, String url, int top_value, String type,  String summary, int read_count) {
		super();
		this.title = title;
		this.content = content;
		this.summary = summary;
		this.date = date;
		this.url = url;
		this.top_value = top_value;
		this.type = type;
		this.read_count = read_count;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}
	public int getTop_value() {
		return top_value;
	}

	public void setTop_value(int top_value) {
		this.top_value = top_value;
	}

	public int getRead_count() {
		return read_count;
	}

	public void setRead_count(int read_count) {
		this.read_count = read_count;
	}
	
	public String getColumn_url() {
		return column_url;
	}

	public void setColumn_url(String column_url) {
		this.column_url = column_url;
	}

	public int compareTo(Article o) {
		// TODO Auto-generated method stub
		if(this.date.getTime() > o.getDate().getTime())
			return -1;
		else if(this.date.getTime() < o.getDate().getTime())
			return 1;
		else 
			return 0;
	}
}
